package com.billdowney.webconfig;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import com.billdowney.service.util.project.SystemAppConst;

/**
 * 开发模式配置，此配置只在系统参数开启开发者模式有用
 * 
 * @author: 唐路钧
 * @date: 2019年1月17日 下午5:50:45
 */
@Configuration
@ConditionalOnProperty(name = SystemAppConst.developModel, havingValue = "true")
public class DevelopConfig implements WebMvcConfigurer {

	@Override
	public void addResourceHandlers(ResourceHandlerRegistry registry) {
		// 将所有/test/** 访问都映射到classpath:/test/ 目录下
		registry.addResourceHandler("/test/**").addResourceLocations("classpath:/test/");
	}

}
